<?php get_template_part('templates/head'); ?>
<body <?php body_class(); ?>>
  <!--[if lt IE 8]>
    <div class="alert alert-warning">
      <?php _e('You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.', 'roots'); ?>
    </div>
  <![endif]-->
  <?php
    do_action('get_header');
    get_template_part('templates/header');
  ?>
  <div class="mainBody">
    <div class="container">
      <div class="row">
        <?php if (function_exists('asahi_kasei_breadcrumb') && !is_home()) { asahi_kasei_breadcrumb(); } ?>
      </div>
      <div class="row">
        <h2 class="title01">
        <?php
          $category = get_the_category();
          $num_cat = count($category);
          $parentCat = get_category_parents($category[0]->cat_ID,true,'');
          //echo $parentCat;

          $parentCatList = get_category_parents(11,false,',');
          $parentCatListArray = split(",",$parentCatList);
          $topParentName = $parentCatListArray[0];
          $sdacReplace = array(" " => " ", "(" => "", ")" => "");
          //$topParent = strtoupper(strtr($topParentName,$sdacReplace));
          echo $topParentName;
        ?>
        </h2>
        <?php if (is_single() || is_category() || is_page()){ ?>
        <aside>
          <div class="col-md-3">
            <?php include roots_sidebar_path(); ?>
          </div>
        </aside>
        <?php
          }
          elseif(is_home()){
            get_template_part('templates/home');
          }
          else{
            include roots_template_path();
          }
        ?>
        <section>
          <div class="col-md-9">
            <h2 class="title02">
            <?php echo $parentCatListArray[1]; ?>
            </h2>
            <h3 class="title03"><?php echo roots_title(); ?></h3>
            <?php while (have_posts()) : the_post(); ?>
              <article <?php //post_class(); ?>>
                <h4 class="title04"><?php the_title(); ?></h4>
                <?php //get_template_part('templates/entry-meta'); ?>
                <div class="inner">
                  <a href="<?php echo get_permalink(); ?>"><?php //the_post_thumbnail(); ?></a>
                  <?php the_content(); ?>
                </div>
                <?php //comments_template('/templates/comments.php'); ?>
              </article>
            <?php endwhile; ?>
            <?php
              wpbeginner_numeric_posts_nav();
              get_next_posts_link();
              get_previous_posts_link();
              paginate_links();
              $args = array(
	'base'         => '%_%',
	'format'       => '?page=%#%',
	'total'        => 1,
	'current'      => 0,
	'show_all'     => False,
	'end_size'     => 1,
	'mid_size'     => 2,
	'prev_next'    => True,
	'prev_text'    => __('« Previous'),
	'next_text'    => __('Next »'),
	'type'         => 'plain',
	'add_args'     => False,
	'add_fragment' => '',
	'before_page_number' => '',
	'after_page_number' => ''
);
echo paginate_links( $args );
            ?>
          </div>
        </section>
      </div>
      <div class="row">
        <a class="backToTop pull-right" href="#">このページのトップへ戻る</a>
      </div>
    </div>
  </div><!-- end mainBody -->
  <?php get_template_part('templates/footer'); ?>
</body>
</html>